package cn.edu.ctbu.service.impl;

import cn.edu.ctbu.domain.Classes;
import cn.edu.ctbu.repository.ClassRepository;
import cn.edu.ctbu.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ClassServiceImpl implements ClassService {


    @Autowired
    private ClassRepository classRepository;

    @Override
    public List<Classes> getAllClass() {
        return classRepository.selectAllClass();
    }

    @Override
    public Classes selectById(String classId) {
        return classRepository.selectClassById(classId);
    }

    @Override
    public int deleteById(String classId) {
        return classRepository.delectClassById(classId);
    }

    @Override
    public int addClass(Classes classes) {
        return classRepository.insertClass(classes);
    }

    @Override
    public Classes selectByName(String className) {
        return classRepository.selectClassByName(className);
    }
}
